import requests
import json

def send_data_to_pushgateway(url, data):
    print(data)
    headers = {
        'Content-Type': 'text/plain'
    }

    response = requests.post(url, data, headers=headers)
    print(response.status_code)

    if response.status_code == 200:
        print('Data sent successfully to pushgateway.')
    else:
        print('Failed to send data to pushgateway.')